package com.cloudlead.common.worker.desc.security;

import java.util.ArrayList;
import java.util.List;

public class SecurityDesc {
    private boolean requireGuest;

    private boolean requireUserInfo;

    private List<RequirePrivilegesDesc> requirePrivilegesDescs;

    private List<RequireRolesDesc> requireRolesDescs;

    private List<RequireGroupsDesc> requireGroupsDescs;

    public boolean isRequireUserInfo() {
        return requireUserInfo;
    }

    public void setRequireUserInfo(boolean requireUserInfo) {
        this.requireUserInfo = requireUserInfo;
    }

    public boolean isRequireGuest() {
        return requireGuest;
    }

    public void setRequireGuest(boolean requireGuest) {
        this.requireGuest = requireGuest;
    }

    public List<RequirePrivilegesDesc> getRequirePrivilegesDescs() {
        return requirePrivilegesDescs;
    }

    public void setRequirePrivilegesDescs(
            List<RequirePrivilegesDesc> requirePrivilegesDescs) {
        this.requirePrivilegesDescs = requirePrivilegesDescs;
    }

    public void addRequirePrivilegesDesc(
            RequirePrivilegesDesc requirePrivilegesDesc) {
        if (null == requirePrivilegesDescs) {
            requirePrivilegesDescs = new ArrayList<>();
        }
        requirePrivilegesDescs.add(requirePrivilegesDesc);
    }

    public List<RequireRolesDesc> getRequireRolesDescs() {
        return requireRolesDescs;
    }

    public void setRequireRolesDescs(List<RequireRolesDesc> requireRolesDescs) {
        this.requireRolesDescs = requireRolesDescs;
    }

    public void addRequireRolesDesc(RequireRolesDesc requireRolesDesc) {
        if (null == requireRolesDescs) {
            requireRolesDescs = new ArrayList<>();
        }
        requireRolesDescs.add(requireRolesDesc);
    }

    public List<RequireGroupsDesc> getRequireGroupsDescs() {
        return requireGroupsDescs;
    }

    public void setRequireGroupsDescs(List<RequireGroupsDesc> requireGroupsDescs) {
        this.requireGroupsDescs = requireGroupsDescs;
    }

    public void addRequireGroupsDesc(RequireGroupsDesc requireGroupsDesc) {
        if (null == requireGroupsDescs) {
            requireGroupsDescs = new ArrayList<>();
        }
        requireGroupsDescs.add(requireGroupsDesc);
    }
}
